package com.ljy.my_study.commons;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.util.List;

public class Person {
	private String name;
	private Integer age;
	private String sex;
	private Double stature;
	
	private List<String> classList;
	
	private List<Clothing> clothes;
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Integer getAge() {
		return age;
	}
	public void setAge(Integer age) {
		this.age = age;
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public Double getStature() {
		return stature;
	}
	public void setStature(Double stature) {
		this.stature = stature;
	}
	public List<String> getClassList() {
		return classList;
	}
	public void setClassList(List<String> classList) {
		this.classList = classList;
	}
	public List<Clothing> getClothes() {
		return clothes;
	}
	public void setClothes(List<Clothing> clothes) {
		this.clothes = clothes;
	}
	@Override
	public String toString() {
		return "Person [name=" + name + ", age=" + age + ", sex=" + sex + ", stature=" + stature + ", classList="
				+ classList + ", clothes=" + clothes + "]";
	}
	
	public static void main(String[] args) {
		try {
			BufferedReader br=new BufferedReader(new InputStreamReader(new FileInputStream("C:\\Users\\hasee\\Desktop\\国家.txt")));
			StringBuilder sb=new StringBuilder();
			sb.append("insert into t_country_code (country_code,filter_sort,is_common_use,cname) values");
			String line=null;
			while((line=br.readLine())!=null) {
				System.out.println();
				String[] ss=line.split("\\s+");
				if(ss.length<4) {
					continue;
				}
				for(String s:ss) {
					System.out.print(s+"---");
				}
				Integer isCommonUse=0;
				if("是".equals(ss[3])) {
					isCommonUse=1;
				}
				sb.append("('"+ss[1]+"','"+ss[2]+"',"+isCommonUse+",'"+ss[0]+"'),");
//				sb.append(line);
			}
			System.out.println();
			System.out.println(sb.substring(0, sb.length()-1));
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
